#include<iostream>
using namespace std;
const int N = 2e3 + 10;
char mp[N][N];
int col[N];
int row[N];
bool st[N][N];
int n, k;
int main()
{
	cin >> n >> k;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> mp[i][j];
			if (mp[i][j] == 'W') {
				st[i][j] = 1;
				col[j]++;
				row[i]++;
			}
		}
	}
	int ma = -100;
	int x = 0, y = 0;
	for (int i = 1; i + k - 1 <= n; i++) {
		for (int j = 1; j + k - 1<= n; j++) {
			int ans = 0;
			int x1 = i, y1 = j;
			int x2 = i + k - 1, y2 = j + k - 1;
			for (int i1 = y1; i1 <= y2; i1++) {
				col[i1]++;
			}
			for (int i1 = x1; i1 <= x2; i1++) {
				row[i1]++;
			}
			for (int i1 = 1; i1 <= n; i1++) {
				if (row[i1] == n) {
					ans++;
				}
			}
			for (int i1 = 1; i1 <= n; i1++) {
				if (col[i1] == n) {
					ans++;
				}
			}
			if (ma < ans) {
				ma = ans;
				x = i;
				y = j;
			}
			for (int i1 = y1; i1 <= y2; i1++) {
				col[i1]--;
			}
			for (int i1 = x1; i1 <= x2; i1++) {
				row[i1]--;
			}
		}
	}
	cout << x << " " << y << endl;
	cout << ma << endl;
	return 0;
}